<?php
namespace app\common\extract;

use app\common\extract\ExtractText;
use app\common\extract\ExtractExecl;
use app\common\extract\Word;

class ExtractFactory
{
    public static function createExtract(string $ext)
    {
        $_extractClass = null;
        switch($ext)
        {
            case "xls": 
            case "xlsx":
                $_extractClass = new ExtractExecl();
                break;
            case "doc":
            case "docx":
                $_extractClass = new Word();
                break;
            case "txt":
                $_extractClass = new ExtractText();
                break;
            default :
                break;
        }
        return $_extractClass;
    }
}